<?php

namespace app\services\exam;

use app\dao\exam\ExamMonitorListDao;
use app\services\BaseService;
use think\App;

class ExamMonitorListService extends BaseService
{
    public function __construct(ExamMonitorListDao $dao)
    {
        $this->dao = $dao;
    }

    public function index(array $where)
    {
        return $this->dao->index($where);
    }

    public function createOrUpdate(array $where)
    {
        if ($where['id']) return $this->dao->updateDao($where);
        return $this->dao->create($where);
    }

    public function delete(array $where)
    {
        return $this->dao->deleteDao($where);
    }

    public function getUserFromId(array $where)
    {
        $data = $this->dao->getUserFromId($where);
        if ($data) return $data['user_ids'];
    }

    public function examPerson(array $where)
    {
        if ($where['exam_id']) return $this -> dao -> examForId($where);
        return $this -> dao -> examPerson($where);
    }

    public function getExamTryRoll(array $where)
    {
        if ($where['idcard']) return $this -> dao ->getExamTryUser($where);
        return $this -> dao -> getExamTryRoll($where);
    }



}